(*************************************************** Ant Movie Catalog importation script www.antp.be/software/moviecatalog/ [Infos] Authors=polnjumen (polnjumen@yahoo.com) Title=Amazon Description=Import picture & editorial review from Amazon Site=www.amazon.com Language=EN Version=1.0 Requires=3.5.0 Comments=Based on the script made for version 3.4.0 by facts (jfacts1731@yahoo.com) License=This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. GetInfo=1 [Options] GetReview=2|1|0=Do not get Editorial Review|1=Save Editorial Review into Description field|2=Save Editorial Review into Comment field ***************************************************) program Amazon; uses StringUtils1; var AmazonPage: TStringList; THolder, MovieName : string; LineNr, I: Integer; function GetToken(aString, SepChar: String; TokenNum: Integer):String; var Token : string; StrLen : Integer; TNum : Integer; TEnd : Integer; begin StrLen := Length(aString); TNum := 1; TEnd := StrLen; while ((TNum <= TokenNum) and (TEnd <> 0)) do begin TEnd := Pos(SepChar,aString); if TEnd <> 0 then begin Token := Copy(aString,1,TEnd-1); Delete(aString,1,TEnd); TNum := TNum + 1; end else begin Token := aString; end; end; if TNum >= TokenNum then begin GetToken := Token; end else begin GetToken := ''; end; end; function AsinParse(Line : string): string; begin Result := GetToken(GetToken(Line,'.',2),Chr(34),1); end; // ***** analyze the page containing movie information ***** procedure AnalyzeMoviePage(AsinNr: string); var MovieURL, PageText, Value, Value2: string; LP: integer; begin GetPicture('http://images.amazon.com/images/P/' + AsinNr + '.01.LZZZZZZZ.jpg'); MovieURL := 'http://www.amazon.com/exec/obidos/tg/detail/-/' + AsinNr + '/'; PageText := GetPage(MovieURL); // URL if CanSetField(fieldURL) then SetField(fieldURL, MovieURL); // DVD Title & Year if CanSetField(fieldOriginalTitle) or CanSetField(fieldYear) then begin Value := TextBetween(PageText, '